FROM hub.baidubce.com/paddlepaddle/serving:latest-cuda10.0-cudnn7-devel

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY requirements.txt /usr/src/app/

RUN pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple
RUN python -m pip install -U https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.post10-py3-none-any.whl
RUN wget --no-check-certificate https://paddleocr.bj.bcebos.com/deploy/pdserving/ocr_pdserving_suite.tar.gz
RUN tar xf ocr_pdserving_suite.tar.gz
RUN apt update

RUN apt install libgl1-mesa-glx -y

COPY . /usr/src/app

EXPOSE 9292

CMD python -m paddle_serving_server_gpu.serve --model det_infer_server --port 9293 --gpu_id 0 && python -m paddle_serving_server_gpu.serve --model cls_infer_server --port 9294 --gpu_id 0 && python ocr_rpc_server.py
